package com.xbongbong.saas.service;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt;
import com.xbongbong.paas.pojo.FieldAttrEntityForImport;
import com.xbongbong.paas.pojo.dto.FormDataAddDTO;
import com.xbongbong.paas.pojo.dto.FormDataDeleteBatchDTO;
import com.xbongbong.paas.pojo.dto.FormDataListDTO;
import com.xbongbong.paas.pojo.dto.ImportFormDataDTO;
import com.xbongbong.paas.pojo.dto.SaasFormSaveDTO;
import com.xbongbong.paas.pojo.dto.ValidateDataDTO;
import com.xbongbong.paas.pojo.imports.CellTitlePojo;
import com.xbongbong.paas.pojo.imports.RowGroupPojo;
import com.xbongbong.paas.pojo.vo.FormDataAddVO;
import com.xbongbong.paas.pojo.vo.FormDataDeleteBatchVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.applist.pojo.vo.ListAppVO;
import com.xbongbong.pro.businessdata.pojo.dto.FormatExplainDTO;
import com.xbongbong.pro.formdata.pojo.dto.SaasAnalysisDataDTO;
import com.xbongbong.pro.otherincome.pojo.dto.OtherIncomeEditAttrUpdateDTO;
import com.xbongbong.pro.otherincome.pojo.dto.OtherIncomeSaveDTO;

import java.util.List;

/**
 * 其他收入单
 * @author zcp
 * @version v1.0
 * @since v1.0
 */
public interface OtherIncomeService {

    /**
     * 格式化移动端列表页
     *
     * @param formDataListDTO 入参
     * @param esEntities 数据列表
     * @param totalCount 数据个数
     * @return com.xbongbong.pro.applist.pojo.vo.ListAppVO
     * @throws XbbException 异常
     * @author zcp
     * @since v1.0
     */
    ListAppVO formatOtherIncomeAppList(FormDataListDTO formDataListDTO, List<PaasFormDataEntityExt> esEntities, Integer totalCount) throws XbbException;

    /**
     * 其他收入单保存前校验
     * @param validateDataDTO
     * @throws XbbException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    void beforeSave(ValidateDataDTO validateDataDTO) throws XbbException;

    /**
     * 新建保存
     * @param otherIncomeSaveDTO 入参
     * @param paasFormDataEntity 数据
     * @param paasFormEntityExt 表单
     * @return com.xbongbong.paas.pojo.vo.FormDataAddVO
     * @throws XbbException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    FormDataAddVO add(OtherIncomeSaveDTO otherIncomeSaveDTO, PaasFormDataEntity paasFormDataEntity, PaasFormEntityExt paasFormEntityExt) throws XbbException;

    /**
     * 其他收入单保存后逻辑
     * @param saasFormSaveDTO
     * @throws XbbException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    void afterSave(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;

    /**
     * 批量编辑
     * @param otherIncomeEditAttrUpdateDTO
     * @throws XbbException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    void batchEditAttr(OtherIncomeEditAttrUpdateDTO otherIncomeEditAttrUpdateDTO) throws XbbException;

    /**
     * 格式化excel导入的数据
     * @param importFormDataDTO
     * @param titlePojoList
     * @param rowGroupPojo
     * @param fieldAttrList
     * @return com.xbongbong.paas.pojo.dto.FormDataAddDTO
     * @throws XbbException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    FormDataAddDTO formatExcelValue(ImportFormDataDTO importFormDataDTO, List<CellTitlePojo> titlePojoList, RowGroupPojo rowGroupPojo, List<FieldAttrEntityForImport> fieldAttrList) throws XbbException;

    void afterSaveForWorkflow(SaasFormSaveDTO saasFormSaveDTO);

    FormDataDeleteBatchVO deleteBatch(FormDataDeleteBatchDTO formDataDeleteBatchDTO) throws XbbException;
}
